package com.shenmazong.servereduuser.controller;

import com.shenmazong.servereduuser.entity.TbStaff;
import com.shenmazong.servereduuser.service.TbStaffService;
import com.shenmazong.utils.ResultResponse;
import com.shenmazong.vo.BatchChooseIdVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author GuanJiaHe
 * @version 1.0
 * @description 职工表控制层
 * @date 2021/9/22 19:21
 */
@Api(tags = {"职工API接口"})
@RestController
@RequestMapping(value = "/staff")
public class TbStaffController {
    @Autowired
    private TbStaffService staffService;

    @ApiOperation(value="增加职工", notes="增加职工", produces="application/json")
    @PostMapping("addStall")
    public ResultResponse addStall(@RequestBody TbStaff tbStaff){
        return staffService.addStall(tbStaff);
    }

    @ApiOperation(value="删除职工", notes="删除职工", produces="application/json")
    @DeleteMapping("deleteStall")
    public ResultResponse deleteStall(@RequestBody BatchChooseIdVo idVo){
        return staffService.deleteStall(idVo);
    }

    @ApiOperation(value="获取职工信息", notes="获取职工信息", produces="application/json")
    @PostMapping("getAllStall")
    public ResultResponse getOneStall(@RequestBody TbStaff staff){
        return staffService.getOndeStaff(staff);
    }

    @ApiOperation(value="修改职工信息", notes="修改职工信息", produces="application/json")
    @PostMapping("updateStall")
    public ResultResponse updateStall(@RequestBody TbStaff staff){
        return staffService.updateStall(staff);
    }
}
